/*
 * @Author: ChunLai
 * @Date: 2022-06-15 15:03:30
 * @LastEditTime: 2025-07-09 10:19:13
 * @Description: 告知配置
 * @FilePath: \01.latest-short-insure\src\store\modules\notice.js
 */
const state = {
  nameList: [],
  autoHealthy: "0", //智能核保接口
  topMsg:
    "为了保证被保人的保险权益在理赔时不受影响，请确认被保人健康状况或职业情况是否符合投保条件。",
  ftbMsg: "",
  ftpMsg: "",
  iframeUrl: "",
};
const getters = {
  nameList: (state) => state.nameList,
  topMsg: (state) => state.topMsg,
  ftbMsg: (state) => state.ftbMsg,
  ftpMsg: (state) => state.ftpMsg,
  iframeUrl: (state) => state.iframeUrl,
  autoHealthy: (state) => state.autoHealthy,
};
const mutations = {
  SET_STATE_FIELD(state, payload) {
    Object.assign(state, payload);
  },
};
const actions = {
  watchNoticeChange({ commit, rootState, state }) {
    const ulist = rootState.insert.bbrList;
    let res = [];
    ulist.forEach((item) => {
      const value = `${item.idNum}${item.idName}`;
      res.push(value);
    });
    sessionStorage.uid_list = JSON.stringify(res);
  },
};

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions,
};
